home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
warpcom.zip
/
TERM.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-01-25
|
1KB
|
37 lines
#include <conio.h>
#include <stdio.h>
#include <process.h>
#include "warpcomm.h"
int main (void)
{
char ch = 0, ch2 = 0;
clrscr ();
cputs (
"A simple terminal program to demonstrate the Warp-Comm library (Ctrl-C to Exit)\r\n\n"
);
com_open (2400, 4, 0x3F8, 2000, 2000);
/* opens the com port at 2400 baud, IRQ 4, base address 3F8 (hex) with
2000 byte transmit and receive buffers */
send_modem_string ("ATZ|");
/* initializes the modem */
while (ch != 3) {
if (kbhit ()) { /* check the keyboard for a keypress */
ch = getch (); /* get the keypress */
com_out_char (ch); /* send the keypress to the modem */
}
if (char_waiting ()) {
/* check to see if the modem has a character waiting */
ch2 = com_get_char (); /* get the character from the com port */
putch (ch2); /* print the character on the screen */
}
}
com_close (); /* close the com port */
exit (0); /* exit with errorlevel 0 */
}